﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Services;
using System.Web.UI;
using System.Web.UI.WebControls;
using Microsoft.WindowsAzure.Storage.Blob;


namespace LoadController
{
    public partial class _AppSetup : Page
    {      
        protected void Page_Load(object sender, EventArgs e)
        {
            Response.Cache.SetExpires(DateTime.UtcNow.AddMinutes(1));
            Response.Cache.SetCacheability(HttpCacheability.NoCache);
            Response.Cache.SetNoStore();
            Response.AppendHeader("pragma", "no-cache");

            //if (!Page.IsPostBack)
            //{
            //    List<AppSettings> lst = new List<AppSettings>();
            //    lst.Add(Global.APP_SETTINGS);

            //    DetailsView1.DataSource = lst;
            //    DetailsView1.ChangeMode(DetailsViewMode.Edit);
            //    DetailsView1.DataBind();
            //}
            //CloudBlobContainer container = AzureBlobHelper.GetContainerReference("result");

            //byte[] bts = AzureBlobHelper.DownloadBlobToByteArray(container, "Job_8588251688187142523");

            //ResultSerializer.Deserialize(bts);

        }

        protected void ButtonSetup_Click(object sender, EventArgs e)
        {
            DetailsView1.UpdateItem(true);
        }

        protected void DetailsView1_ItemUpdating(object sender, DetailsViewUpdateEventArgs e)
        {
            var qq = DetailsView1.DataSource;
            var test = DetailsView1.DataItem;

            //Global.APP_SETTINGS.UpdateAppSettings();
        }

        protected void Button1_Click(object sender, EventArgs e)
        {
            AutoScaler ac = new AutoScaler();

            string requestid = ac.ChangeConfiguration(2);
        }

    }
}